
%option noyywrap

%{
#include <stdio.h>
%}

int [1-9][0-9]*
float [0-9]+\.[0-9]+
id [a-z,A-Z,_][0-9,a-z,A-Z,_]*

"%%"

"void"          { printf("KEY_void\n"); }
"char"          { printf("KEY_char\n"); }
"int"           { printf("KEY_int\n"); }
"float"         { printf("KEY_float\n"); }
"struct"        { printf("KEY_struct\n"); }
"typedef"       { printf("KEY_typedef\n"); }
"while"         { printf("KEY_while\n"); }
"break"         { printf("KEY_break\n"); }
"continue"      { printf("KEY_\n"); }
"if"            { printf("KEY_\n"); }
"else"          { printf("KEY_\n"); }
"switch"        { printf("KEY_\n"); }
"case"          { printf("KEY_\n"); }
"default"       { printf("KEY_\n"); }
"return         { printf("KEY_\n"); }
"+"             { printf("PCT_\n"); }
"-"             { printf("PCT_\n"); }
"*"             { printf("PCT_\n"); }
"/"             { printf("PCT_\n"); }
"%"             { printf("PCT_\n"); }
"|"             { printf("PCT_\n"); }
"&"             { printf("PCT_\n"); }
"^"             { printf("PCT_\n"); }
"~"             { printf("PCT_\n"); }
"!"             { printf("PCT_\n"); }
"="             { printf("PCT_\n"); }
"<"             { printf("PCT_\n"); }
">"             { printf("PCT_\n"); }
"<="            { printf("PCT_\n"); }
">="            { printf("PCT_\n"); }
"!="            { printf("PCT_\n"); }
"("             { printf("PCT_\n"); }
")"             { printf("PCT_\n"); }
"["             { printf("PCT_\n"); }
"]"             { printf("PCT_\n"); }
"{"             { printf("PCT_\n"); }
"}"             { printf("PCT_\n"); }
"."             { printf("PCT_\n"); }
"\""            { printf("PCT_\n"); }
"->"            { printf("PCT_\n"); }
{id}       { printf("word !!!\n"); }
{int}        { printf("number !!!\n"); }
{float}
.               { printf("unknown!!! \n");}

%%

int main() {
    yylex();
    return 0;
}

